# 8.打印1~40所有奇数的平方的和
a = 1
sum1 = 0
while a <= 40:
    temp = a ** 2   #临时变量
    sum1 += temp
    a += 2
print(sum1)
# 第二种方法
while a <= 40:
    if a % 2 != 0:
        sum1 += a ** 2
    a += 1
print(sum1)
